import req from "@/utils/request";
const baseURL = process.env.VUE_APP_BASE_URL;

//能源配置
//获取费率列表
export function getElectrovalenceList(data) {
  return req({
    method: "get",
    url: baseURL + "/superlink/api/electrovalence/list",
    params: data
  });
}
//创建峰谷平时间段
export function createElectrovalence(data) {
  return req({
    method: "post",
    url: baseURL + "/superlink/api/electrovalence/create",
    data
  });
}
//编辑峰谷平信息
export function updateElectrovalence(data, token) {
  return req({
    method: "put",
    url: baseURL + "/superlink/api/electrovalence/update/" + token,
    data
  });
}
//删除峰谷平时间段
export function deleteElectrovalence(token) {
  return req({
    method: "delete",
    url: baseURL + "/superlink/api/electrovalence/delete/"+token,
  });
}

// 用能统计
export function getHarfHourList(data) {
  return req({
    method: "post",
    url: baseURL + "/superlink/api/electric/generateHarf",
     data
  });
}
export function getElectricList(data) {
  return req({
    method: "post",
    url: baseURL + "/superlink/api/electric/statics",
    data
  });
}

//能源报表
//获取列表
export function getReportList(data) {
  return req({
    method: "get",
    url: baseURL + "/superlink/api/electric/report",
    params: data
  });
} 
//获取环形图
export function getChartList(data) {
  return req({
    method: "get",
    url: baseURL + "/superlink/api/electric/chart",
    params: data
  });
}
//导出
export function exportData(data) {
  return req({
    method: "get",
    url: baseURL + "/superlink/api/electric/export",
    params: data,
    responseType: 'arraybuffer',
  });
}

